﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Best.SmartCms.API.Migrations
{
    public partial class AddChannel : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Channel",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    Name = table.Column<string>(maxLength: 50, nullable: true),
                    Content = table.Column<string>(maxLength: 500, nullable: true),
                    Keywords = table.Column<string>(maxLength: 255, nullable: true),
                    Description = table.Column<string>(maxLength: 255, nullable: true),
                    IsShowMenu = table.Column<bool>(nullable: false),
                    OrderNo = table.Column<int>(nullable: false),
                    CreatedTime = table.Column<DateTime>(nullable: true),
                    CreatorId = table.Column<string>(maxLength: 50, nullable: true),
                    CreatorName = table.Column<string>(maxLength: 50, nullable: true),
                    UpdatedTime = table.Column<DateTime>(nullable: true),
                    UpdatorId = table.Column<string>(maxLength: 50, nullable: true),
                    UpdatorName = table.Column<string>(maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Channel", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Channel");
        }
    }
}
